
******** Replication Data for: "Neighborly Social Pressure and Collective Action: Evidence from A Field Experiment in Tunisia" **********

*** Prisca Jöst, University of Konstanz and University of Marburg


********** ANALYSIS OF FIELD EXPERIMENT ********

use "Replication_data_final.dta" 


****** BALANCE TESTS: Table 1 *******

tab female treatment, col row
tab female treatment, chi2

tab class2 treatment, col row
tab class2 treatment, chi2

tab age_b treatment, col row
tab age_b treatment, chi2

tab poor treatment, col row
tab poor treatment, chi2

tab unemployed treatment, col row
tab unemployed treatment, chi2

tab educ treatment, col row
tab educ treatment, chi2

****** OBSERVATIONAL ANALYSIS: Main Text *******

* How much are public spaces in need of cleanup?

tab need_cleanup v101, row col
tab need_cleanup v101, chi2

* do you think this beach needs a cleanup
tab beach_cleanup v101, row col
tab beach_cleanup v101, chi2

* will come to this place in the future
tab future v101, row col
tab future v101, chi2

* a trashed environment represents a health risk to me and my family

tab risk v101, row col

*drop if risk==3 
*drop if risk==2
*drop if risk==1
ranksum  risk, by(v101) exact


* when there are collective activities in this neighborhood, like cleaning a park or helping a family in need, do you think most of your neighbors help, more than half help, less than half help, almost none help? 

tab part_every2 v101, chi2
tab part_every2 v101, row col

* keeping public spaces (e.g., the beach, playgrounds, etc.) clean is a civic duty 0-10 scale
tab civic_duty v101, row col

*drop if v101==3 
*drop if v101==2
*drop if v101==1

ranksum  v210_3, by(v101) exact

* neighborhood initiatives lead to good outcomes for the community

tab good_outcomes v101, row col
tab good_outcomes v101, chi2


***** SOCIAL TIES ******

* recode density of ties: how many people do you know in the neighborhood 

gen density_binary = .
replace density_binary = 1 if density_n==3 | density_n==4
replace density_binary = 0 if density_n==1 | density_n==2

tab density_binary v101, row col
tab density_binary v101, chi2

*When you think about your neighbors, are most, some, only a few or none of them related to you? 


gen related_binary = .
replace related_binary = 1 if related_n==3 | related_n==4
replace related_binary = 0 if related_n | related_n==2

tab related_binary v101, row col
tab related_binary v101, chi2

*When you think about where your friends live, would you say: <1> None live in this neighborhood <2> Few live in this /neighborhood <3> Some, but not most, live in this neighborhood <4> Most live in this neighborhood <98> Don't Know/Refuse to answer

gen friends_binary = .
replace friends_binary = 1 if friends_n==3 | friends_n==4
replace friends_binary = 0 if friends_n==1 | friends_n==2

tab friends_binary v101, row col
tab friends_binary v101, chi2


* years lived in the neighborhood 
mean(years) if v101==1
mean(years) if v101==2
mean(years) if v101==3
mean(years)


* additional nonparametric tests for 2x2 tables: 2 categorical variables
* chi2 test (but assumption that at least 5 in each category must be met)
tabulate treatment participation_cleanup, chi2
tabulate participation_cleanup treatment, row col

* Fisher exact test if min. 5 per category is not met 
tabulate treatment participation_cleanup, exact

**** Intended Participation
*drop if called==3 ## only for analysis with intended participation

gen int_part2=.
replace int_part2 = 1 if called == 1
replace int_part2 = 0 if called == 2

* For intended participation; nonparametric tests for 2x2 tables: 2 categorical variables
* chi2 test (but assumption that at least 5 in each category must be met)
tabulate treatment int_part2, chi2
tabulate int_part2 treatment, row col

* Fisher exact test if min. 5 per category is not met 
tabulate treatment int_part2, exact

* by neighborhood
* 1 Kram 2 Goulette 3 Marsa
tabulate treatment participation_cleanup if v101==1, chi2 
tabulate treatment participation_cleanup if v101==2, chi2
tabulate treatment participation_cleanup if v101==3, chi2


tabulate treatment participation_cleanup if v101==1, exact
tabulate treatment participation_cleanup if v101==2, exact
tabulate treatment participation_cleanup if v101==3, exact


************ EXPERIMENTAL ANALYSIS: Figure 1 ************
****** with controls for age and poor

*** Actual Participation
* Regression OLS by neighborhood
* 1 Kram 2 Goulette 3 Marsa
reg participation_cleanup treatment i.age_b i.poor
est store full4
 reg participation_cleanup treatment i.age_b i.poor if v101==1
 est store kram4
  reg participation_cleanup treatment i.age_b i.poor if v101==2
  est store goulette4
   reg participation_cleanup treatment i.age_b i.poor if v101==3
   est store marsa4

* controlling for neighborhood   
reg participation_cleanup i.v101 i.age_b i. poor, vce(robust)
logistic participation_cleanup treatment i.v101 i.age_b i. poor, or


**** Intended Participation
** important run intended participation analysis after dropping called == 3
reg int_part2 i.v101 i.age_b i. poor, vce(robust)
logistic int_part2 treatment i.v101 i.age_b i. poor, or

* Regression OLS by neighborhood
* 1 Kram 2 Goulette 3 Marsa
reg int_part2 treatment i.age_b i.poor
est store full3
 reg int_part2 treatment i.age_b i.poor if v101==1
 est store kram3
  reg int_part2 treatment i.age_b i.poor if v101==2
  est store goulette3
   reg int_part2 treatment i.age_b i.poor if v101==3
   est store marsa3

* Figure 1 in main text
coefplot (full4 \ full3), xline(0) drop(*age_b *poor *cons)  aseq swapnames    
   
 

 ************ Without controls ************  

 
***** ACTUAL PARTICIPATION 
* Regression OLS by neighborhood
* 1 Kram 2 Goulette 3 Marsa
reg participation_cleanup treatment
est store full
 reg participation_cleanup treatment if v101==1
 est store kram
  reg participation_cleanup treatment if v101==2
  est store goulette
   reg participation_cleanup treatment if v101==3
   est store marsa
 

** DIFFERENCES BETWEEN PARTICIPATION RATES BY NEIGHBORHOODS
*drop if v101==3 
*drop if v101==2
*drop if v101==1

tabulate v101 participation_cleanup, chi2

* compared to la marsa, differences across neighborhoods with robust SE for heteroscedasticity
reg participation_cleanup i.v101, vce(robust) 

* compared to la marsa, differences across neighborhoods with robust SE for heteroscedasticity
reg participation_cleanup i.treatment##i.v101, vce(robust) 


***** INTENDED PARTICIPATION 
** important run intended participation analysis after dropping called == 3

* Regression OLS by neighborhood
* 1 Kram 2 Goulette 3 Marsa
reg int_part2 treatment
est store full2
 reg int_part2 treatment if v101==1
 est store kram2
  reg int_part2 treatment if v101==2
  est store goulette2
   reg int_part2 treatment if v101==3
   est store marsa2

* Combined Graph for actual and intented participation_cleanup

coefplot (full \ kram \ goulette \ marsa \ full2 \ kram2 \ goulette2 \ marsa2), xline(0) drop(*cons)  aseq swapnames 

coefplot (full \ kram \ goulette \ marsa), xline(0) drop(*cons)  aseq swapnames 

coefplot (full2 \ kram2 \ goulette2 \ marsa2), xline(0) drop(*cons)  aseq swapnames 

***** Data for Figure 2 *****
tab participation_cleanup v101, row col
tab called v101, row col
tab int_part2 v101, row col


***** Figure 3 *****
** Average Treatment Effects using Actual and Intended Participation as DVs and Interaction between Neighborhood Context and Social Pressure (95% CIs).

reg participation_cleanup i.treatment##ib2.v101 i.age i.poor, vce(robust) 
coefplot, xline(0) drop(*age_b *poor *_cons) aseq swapnames 

* drop those who could not be reached from the analysis 
** important run intended participation analysis after dropping called == 3

gen int_part2=.
replace int_part2 = 1 if called == 1
replace int_part2 = 0 if called == 2

reg int_part2 i.treatment##i.v101 i.age_b i.poor, vce(robust) 
est store int2
coefplot, xline(0) drop(*age_b *poor *_cons) aseq swapnames 


******* Predicted probablilities with controls for for age, gender, education, income, employment status held at the median level with clustered standard errors at the neighborhood level

logit participation_cleanup i.treatment i.female ib1.educ i.age_b i.unemployed, or vce(cluster v101)  

margins treatment, atmeans

reg participation_cleanup i.treatment i.female ib1.educ i.age_b i.unemployed, vce(cluster v101) 
margins treatment, atmeans

reg int_part2 i.treatment

logit int_part2 i.treatment i.female ib1.educ i.age_b i.unemployed, or vce(cluster v101)  

margins treatment, atmeans



** did the treatment work? how did you know each other
tab know_rec treatment, row col

* median age among recruited heads of household
sum age_b, detail


***************************************************************
********* PRE-REGISTERED HYPOTHESES TESTS ******************
***************************************************************

**H1c. Mode of Recruitment and Trash bags filled

reg trashbag i.treatment, vce(robust) 

**H2a. Mechanisms by mode of recruitment
* density, duty, social trust, monitoring, solidarity by mode


*duty to reciprocate with neighbor: We would like to understand how people interact in your area.  How much do you think people are obligated to help others, even if it costs them a day's wages? Would you say that the person is <1> not obligated at all to help, <2> somewhat obligated, or <3> very obligated, if the person is…

gen duty_neighbor2 = .
replace duty_neighbor2 = 1 if duty_neighbor == 1
replace duty_neighbor2 = 2 if duty_neighbor == 2
replace duty_neighbor2 = 3 if duty_neighbor == 3
label define duty_neighbor2 1 "not at all" 2 "somewhat" 3 "very" 
label value duty_neighbor2 duty_neighbor2

*Please tell me how much you trust your neighbors. 

gen trust2 = .
replace trust2 = 1 if trust == 1
replace trust2 = 2 if trust == 2
replace trust2 = 3 if trust == 3
replace trust2 = 4 if trust == 4
replace trust2 = 98 if trust == 5
label define trust2 1 "distrust very much" 2 "distrust somewhat" 3 "trust somewhat" 4 "trust very much" 
label value trust2 trust2

*If an event is held in your neighborhood, do you think your neighbors keep track of whether you attend it? 

gen monitoring2 = . 
replace monitoring2 = 1 if monitoring == 1
replace monitoring2 = 0 if monitoring == 2

*duty 
tab duty_neighbor treatment, chi2
tab duty_neighbor treatment, row col

*trust
tab trust treatment, chi2
tab trust treatment, row col

*monitoring
tab monitoring treatment, chi2
tab monitoring treatment, row col

*sanctioning sum(sanction) if treatment == 1 etc.

*belonging
tab belonging treatment, chi2
tab belonging treatment, row col

**H2b. Mechanisms times Mode on participation


reg duty_neighbor2 i.treatment, vce(cluster v101)
reg trust2 i.treatment, vce(cluster v101)
reg monitoring2 i.treatment, vce(cluster v101)
reg sanction i.treatment, vce(cluster v101)
reg belonging i.treatment, vce(cluster v101)

**3a. Mechanisms by individual wealth

tab duty_neighbor poor, chi2
tab duty_neighbor poor, row col

tab trust poor, chi2
tab trust poor, row col

tab monitoring poor, chi2
tab monitoring poor, row col

tab belonging poor, chi2
tab belonging poor, row col

**3b. individual poverty time mode on participation_cleanup

* Regression OLS by neighborhood
* 1 Kram 2 Goulette 3 Marsa


reg participation_cleanup i.treatment##i.poor, vce(cluster v101) 
 reg participation_cleanup treatment if poor==1
 est store poor
  reg participation_cleanup treatment if poor==0
  est store wealthy

   
coefplot poor wealthy, drop(*cons) xline(0) xlabel(-1.5 -1 -.5 0 .5) 


**4a. mechnisms by context

tab duty_neighbor v101, chi2
tab duty_neighbor v101, row col

tab trust v101, chi2
tab trust v101, row col

tab monitoring v101, chi2
tab monitoring v101, row col

tab belonging v101, chi2
tab belonging v101, row col

**4c. interaction with full sample
reg participation_cleanup i.treatment##ib2.v101 i.age i.poor, vce(robust) 
coefplot, xline(0) drop(*age_b *poor *_cons) aseq swapnames 

* drop those who could not be reached from the analysis 
drop if called==3

gen int_part2=.
replace int_part2 = 1 if called == 1
replace int_part2 = 0 if called == 2

reg int_part2 i.treatment##i.v101 i.age_b i.poor, vce(robust) 
est store int2
coefplot, xline(0) drop(*age_b *poor *_cons) aseq swapnames 

**5a. poor only: context participation_cleanup
drop if poor==0

reg participation_cleanup i.treatment##i.v101, vce(robust) 

**5b. not possible, no secondary recruits


* * * *  Power calculation for data * * * * 

*keep if v101==1
*keep if v101==2
*keep if v101==3

*keep if control == 1
*keep if control == 0

sum participation_cleanup, detail

drop if called==3

gen int_part2=.
replace int_part2 = 1 if called == 1
replace int_part2 = 0 if called == 2

sum int_part2, detail


* 1 Kram 2 Goulette 3 Marsa

tab int_part2 poor if v101==2
tab int_part2 poor if v101==1